﻿<%@ Page Title="Networks" Theme="POSSystem" Language="C#" MasterPageFile="~/EditPages/Popup.Master"
    AutoEventWireup="true" CodeBehind="NetworkList.aspx.cs" Inherits="WebUI.EditPages.NetworkList" %>

<%@ Register Src="~/Controls/POSControls/NetworkListCtrl.ascx" TagName="NetworkList"
    TagPrefix="uc" %>
<%@ Register Src="~/Controls/POSControls/EditNetworkCtrl.ascx" TagName="EditNetwork"
    TagPrefix="uc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="PopupHeadHolder" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PopupToolbarHolder" runat="server">

    <script type="text/javascript">
        function onSelectRow() {
            var id = getSelectedItemID<%=networkList.ClientID %>();
            document.getElementById("<%=hidSelectedID.ClientID %>").value = id;
            document.getElementById("<%=btnLoad.ClientID %>").click();
        }
        
        function onRemove(){
            var id = getSelectedItemID<%=networkList.ClientID %>();
            if(id == ""){
                alert("Please select an item!"); 
                return false;
            }   
            return confirm("Are you sure to delete selected Network?");
        }
    </script>
    
    <table class="popuptoolbar" width="100%">
        <tr>
            <td style="vertical-align: middle; text-align: left">
                <asp:LinkButton class="tbbutton" ID="btnAdd" runat="server" OnClick="btnAdd_OnClick" >
                    <asp:Image ID="img1" runat="server" ImageUrl="~/Images/AddRecord.gif" /><asp:Label
                        ID="label1" runat="server" Text=" Add"></asp:Label>
                </asp:LinkButton>
                <asp:LinkButton class="tbbutton" ID="btnEdit" runat="server" OnClick="btnEdit_OnClick">
                    <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/Edit.gif" /><asp:Label ID="label2"
                        runat="server" Text=" Edit"></asp:Label>
                </asp:LinkButton>
                <asp:LinkButton class="tbbutton" ID="btnDelete" OnClientClick="return onRemove();" runat="server" OnClick="btnDelete_OnClick">
                    <asp:Image ID="Image2" runat="server" ImageUrl="~/Images/Delete.gif" /><asp:Label
                        ID="label3" runat="server" Text=" Delete"></asp:Label>
                </asp:LinkButton>
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PopupContentHolder" runat="server">
    <uc:NetworkList Width="100%" ID="networkList" runat="server" AllowPaging="true" PageSize="2"
        AllowSelecting="true" SaveOnCommit="false" />
    <div style='height: 10px'>
        &nbsp;</div>
    <asp:UpdatePanel ID="updateInfo" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <uc:EditNetwork  Enable="false" ID="editNet" runat="server" Width="90%" />
            <div style='height: 5px'>
                &nbsp;</div>
            <div style="margin-left: 80px">
                <asp:Button ValidationGroup="Save" ID="btnSave" runat="server" Text="Save" OnClick="btnSave_OnClick" />
                <asp:Button ID="btnCancel" runat="server" Text="Cancel" OnClick="btnCancel_OnClick" />
                <asp:Button ID="btnLoad" runat="server" Text="Load" OnClick="btnLoad_OnClick" Style="display: none" />
                <asp:HiddenField ID="hidSelectedID" runat="server" />
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
